package com.molyfun.parents.activity.common.listactivity;

import android.content.Context;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:10/28/16.
 */
public abstract class AbstractListFactory<T> {

    protected OnListOperationCallback mOnListOperationCallback;

    public void setOnListOperationCallback(OnListOperationCallback onListOperationCallback){
        this.mOnListOperationCallback = onListOperationCallback;
    }

    public abstract int getTitle();

    public abstract void getDataList(int pageNum, IResponse response);

    public abstract RecyclerView.ViewHolder getViewHolder(ViewGroup parent, int viewType);

    public abstract void bindViewHolder(Context context, T data, RecyclerView.ViewHolder holder, int position, FragmentManager fragmentManager, int totalSize);

    public abstract void deleteData(String id, int position);

    public interface OnListOperationCallback{
        void onLongClick(String id, int position);
        void onDataDelete(int position);
    }

}
